<div class="alert alert-success" role="alert">
  您正在<strong>编辑文章</strong>！
  <button class="btn btn-default btn-bor-success back-to-list" type="button" (click)="$event.view.history.back()">返回列表
  </button>
</div>

<form #modifyArticleForm="ngForm">

  <div class="form-group clearfix">
    <label class="col-md-2">文章标题</label>
    <div class="col-md-6">
      <input type="text" class="form-control" required  name="articleTitle" #articleTitle="ngModel" [(ngModel)]="modifyArticle.title">
      <p [hidden]="articleTitle.pristine || articleTitle.valid" class="alert alert-danger">文章标题不能为空!</p>
    </div>
  </div>
  <div class="form-group clearfix">
    <label class="col-md-2">文章优化标题</label>
    <div class="col-md-6">
      <input type="text" class="form-control" required  name="articleSeoTitle" #articleSeoTitle="ngModel" [(ngModel)]="modifyArticle.seo_title">
      <p [hidden]="articleSeoTitle.pristine || articleSeoTitle.valid" class="alert alert-danger">文章优化标题不能为空!</p>
    </div>
  </div>
  <div class="form-group clearfix">
    <label class="col-md-2">文章分类</label>
    <div class="col-md-2">
      <select class="form-control" name="category" [(ngModel)]="modifyArticle.category_id">
        <option *ngFor="let item of classifyList" value="{{item.id}}">{{item.name}}</option>
      </select>
    </div>
  </div>
  <div class="form-group clearfix">
    <label class="col-md-2">封面上传</label>
    <div class="col-md-6">
      <div class="ui-file">
        <i class="iconfont icon-add"></i>
        上传图片
        <input class="ui-file-input" type="file" name="license" (change)="uploadImg($event)">
      </div>
      <div class="edvert-photo-warp">
        <img class="imgSize" src="{{img_url}}">
      </div>
    </div>
  </div>
  <div class="form-group clearfix">
    <label class="col-md-2">SEO说明</label>
    <div class="col-md-6">
      <input type="text" class="form-control" required  name="articleExcerpt" #articleExcerpt="ngModel" [(ngModel)]="modifyArticle.excerpt">
      <p [hidden]="articleExcerpt.pristine || articleExcerpt.valid" class="alert alert-danger">SEO说明不能为空!</p>
    </div>
  </div>
  <div class="form-group clearfix">
    <label class="col-md-2">标签关键字</label>
    <div class="col-md-6">
      <input type="text" class="form-control" required  name="metaKeywords" #metaKeywords="ngModel" [(ngModel)]="modifyArticle.meta_keywords">
      <p [hidden]="metaKeywords.pristine || metaKeywords.valid" class="alert alert-danger">标签关键字不能为空!</p>
    </div>
  </div>
  <div class="form-group clearfix">
    <label class="col-md-2">标签说明</label>
    <div class="col-md-6">
      <input type="text" class="form-control" required  name="metaDescription" #metaDescription="ngModel" [(ngModel)]="modifyArticle.meta_description">
      <p [hidden]="metaDescription.pristine || metaDescription.valid" class="alert alert-danger">标签说明不能为空!</p>
    </div>
  </div>
  <div class="form-group clearfix">
    <label class="col-md-2">文章唯一标识</label>
    <div class="col-md-6">
      <input type="text" class="form-control" required  name="slug" #slug="ngModel" [(ngModel)]="modifyArticle.slug">
      <p [hidden]="slug.pristine || slug.valid" class="alert alert-danger">文章唯一标识不能为空!</p>
    </div>
  </div>
  <div class="form-group row">
    <label class="col-md-2 col-form-label">状态</label>
    <div class="col-md-5">
      <div class="ui-radio" [class.ui-radioed]="modifyArticle.status == '1'">
        <i class="iconfont icon-iconfontradiobox"></i><span>发布</span>
        <input type="radio" [(ngModel)]="modifyArticle.status" value="1" name="1" (click)="modifyArticle.status = '1';">
      </div>
      <div class="ui-radio" [class.ui-radioed]="modifyArticle.status == '2'">
        <i class="iconfont icon-iconfontradiobox"></i><span>草稿</span>
        <input type="radio" [(ngModel)]="modifyArticle.status" value="2" name="2" (click)="modifyArticle.status = '2';">
      </div>
      <div class="ui-radio" [class.ui-radioed]="modifyArticle.status == '3'">
        <i class="iconfont icon-iconfontradiobox"></i><span>待定</span>
        <input type="radio" [(ngModel)]="modifyArticle.status" value="3" name="3" (click)="modifyArticle.status = '3';">
      </div>
    </div>
  </div>
  <div class="form-group row">
    <label class="col-md-2 col-form-label">是否置顶</label>
    <div class="col-md-5">
      <div class="ui-radio" [class.ui-radioed]="modifyArticle.featured == 1">
        <i class="iconfont icon-iconfontradiobox"></i><span>是</span>
        <input type="radio" [(ngModel)]="modifyArticle.featured" value="true" name="featuredTrue" (click)="modifyArticle.featured = 1;">
      </div>
      <div class="ui-radio" [class.ui-radioed]="modifyArticle.featured == 0">
        <i class="iconfont icon-iconfontradiobox"></i><span>否</span>
        <input type="radio" [(ngModel)]="modifyArticle.featured" value="false" name="featuredFalse" (click)="modifyArticle.featured = 0;">
      </div>
    </div>
  </div>
  <div class="form-group row">
    <label class="col-md-2 col-form-label">文章内容</label>
    <div class="col-md-10 article-content">
      <editor (onPostData)="PostData($event)"></editor>
    </div>
  </div>
</form>
<div class="text-center">
  <button type="submit" class="btn btn-success" [disabled]="!modifyArticleForm.form.valid||!modifyArticle.body" (click)="submitForm()">提 交</button>
  <button class="btn btn-default">取 消</button>
</div>

<app-notification [type]="type" [message]="message" [isShow]="isShow" (promptIsShow)="isShow = $event;"></app-notification>


